package com.course.designpatterns.strategy;

import java.util.Arrays;

/**
 * @author ：Jack Hao
 * @date ：Created in 2021/6/20 21:34
 * @description：
 */
public class Main
{
    public static void main(String[] args)
    {
        Cat[] cat = {new Cat(2, 2), new Cat(6, 6), new Cat(3, 3)};
//        Sorter1.sort(cat);
//        System.out.println(Arrays.asList(cat));


        Dog[] dog = {new Dog(3), new Dog(5), new Dog(2)};
//        Sorter1.sort(dog);
//        System.out.println(Arrays.asList(dog));

        Sorter2 sorter2 = new Sorter2();
        sorter2.sort(dog,new DogComparator());
        System.out.println(Arrays.asList(dog));

        sorter2.sort(cat,new CatWeightComparator());
        System.out.println(Arrays.asList(cat));


        sorter2.sort(cat,new CatHeightComparator());
        System.out.println(Arrays.asList(cat));
    }
}
